const express = require('express')

// 创建路由容器
const router = express.Router()

const db = require('../../db')

router.get('/getNewsListTotal', function(req, resp) {
  const querySql = 'SELECT * FROM NewsListTotal'
  db.query(querySql, [], (res) => {
    if (res && res.length > 0) {
      resp.json(res)
    } else {
      resp.json({
        total: 0
      })
    }
  })
})

module.exports = router
